import { request } from 'umi';
import type { BasicGood, BasicProgress, Params, ItemDataType } from './data.d'
import DJANGO_HOST from '../../../../config/global_var';

export async function queryBasicProfile(params: Params): Promise<{
  data: {
    news: ItemDataType
  };
}> {
  return request(DJANGO_HOST + '/news/profile', {
    params,
  }).then(
    (res) => {
      const ele = res.news;
      const new_item = {
        time: ele.time,
        category: ele.category,
        source: ele.source,
        url: ele.url,
        href: ele.href,
        id: ele.id,
        title: ele.title,
        content: ele.content,
      }
      // console.log(res.list);
      return { "data": { "news": new_item } };
    })
}
